<template>
  <div class="item-size-choose" @touchmove.stop.prevent>
    <div
      :class="{
        mask: true,
        animated: true,
        fadeIn: !pageLeave,
        fadeOut: pageLeave
      }"
      @click="maskClick"
    ></div>
    <div
      :class="{
        'choose-panel': true,
        animated: true,
        slideInUp: !pageLeave,
        slideOutDown: pageLeave
      }"
      @click.stop
    >
      <!-- <div class="btn text" @click="$router.push('/new-dynamics')">
               <img src="@/assets/发布动态交互-assets/p.png" alt="" />
               <div>
                 <div class="main-text">图文</div>
                 <div class="sub-text">拍照或相册上传</div>
               </div>
             </div>-->
      <div
        class="btn video"
        @click="
          $router.push('/new-dynamics-video');
          $emit('panelClose');
        "
      >
        <img src="@/assets/发布动态交互-assets/v.png" alt="" />
        <div>
          <div class="main-text">视频</div>
          <div class="sub-text">上传短视频</div>
        </div>
      </div>
      <div @click="maskClick" class="btn-close">×</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pageLeave: false
    };
  },
  methods: {
    maskClick() {
      this.pageLeave = true;
      setTimeout(() => {
        this.$emit("panelClose", "");
      }, 400);
    }
  }
};
</script>

<style lang="less" scoped>
.item-size-choose {
  z-index: 9999;
  position: relative;

  .mask {
    animation-duration: 0.4s;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
  }

  .choose-panel {
    animation-duration: 0.4s;
    z-index: 10000;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 5.18rem;
    background-color: #fff;
    border-top-left-radius: 0.4rem;
    border-top-right-radius: 0.4rem;
    display: flex;
    justify-content: space-around;
    .btn {
      width: 50%;
      display: flex;
      justify-content: center;

      img {
        height: 1.5rem;
        margin-top: 1.84rem;
      }

      .main-text {
        color: rgba(68, 74, 89, 1);
        font-size: 0.64rem;
        margin-top: 1.84rem;
        margin-left: 0.5rem;
      }

      .sub-text {
        color: rgba(153, 153, 153, 1);
        margin-top: 0.1rem;
        margin-left: 0.5rem;
        font-size: 0.52rem;
      }
    }

    .text {
      border-right: 1px solid #dfdfdf;
    }

    .btn-close {
      position: fixed;
      right: 0.54rem;
      bottom: 4rem;
      font-size: 0.8rem;
    }
  }
}
</style>
